package com.spring.application;

import com.spring.dao.BookDao;
import com.spring.entity.Person;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.SQLException;

public class SpringApplication_8 {

    //使用注解的方式管理Spring组件
    @Test
    public void getSpringAnnocation() throws SQLException {
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-8.xml");
        BookDao bookDao = context.getBean("bookDao", BookDao.class);
        System.out.println(bookDao);
    }
}
